home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** FSSpec compatibility functions.
- **
- ** by Jim Luther, Apple Developer Technical Support
- **
- ** File: FSpCompat.h
- **
- ** Copyright © 1992-1994 Apple Computer, Inc.
- ** All rights reserved.
- **
- ** You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "DSC Sample Code"
- ** after having made changes. If you're going to re-distribute the source,
- ** we require that you make it clear in the source that the code was
- ** descended from Apple Sample Code, but that you've made changes.
- */
-
- #ifndef __FSPCOMPAT__
- #define __FSPCOMPAT__
-
- #ifndef __CONDITIONALMACROS__
- #include <ConditionalMacros.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __LOWMEM__
- #include <LowMem.h>
- #endif
-
- #ifndef __GESTALTEQU__
- #include <GestaltEqu.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __SCRIPT__
- #include <Script.h>
- #endif
-
- /* The old interfaces needed this for the gestaltQuickTime selector */
- //#ifndef __MOVIES__
- //#include <Movies.h>
- //#endif
-
- #ifndef __MOREFILESEXTRAS__
- #include "MoreFilesExtras.h"
- #endif
-
- /*****************************************************************************/
-
- pascal OSErr FSMakeFSSpecCompat(short vRefNum,
- long dirID,
- ConstStr255Param fileName,
- FSSpecPtr spec);
- /* Differences from FSMakeFSSpec:
- If the file system can't create the FSSpec, then the compatibility code
- creates a FSSpec that is exactly like an FSSpec except that spec.name
- for a file may not have the same capitalization as the file's catalog
- entry on the disk volume. That is because fileName is parsed to get the
- name instead of getting the name back from the file system. This works
- fine with System 6 where FSMakeSpec isn't available.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpOpenDFCompat(const FSSpec *spec,
- char permission,
- short *refNum);
- /* Differences from FSpOpenDF:
- If FSpOpenDF isn't available, FSpOpenDFCompat uses PHBOpen because
- System 6 doesn't support PBHOpenDF. This means FSpOpenDFCompat could
- accidentally open a driver if the spec->name begins with a period.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpOpenRFCompat(const FSSpec *spec,
- char permission,
- short *refNum);
- /* No known differences from FSpOpenRF.
- */
-
-
- /*****************************************************************************/
-
- pascal OSErr FSpCreateCompat(const FSSpec *spec,
- OSType creator,
- OSType fileType,
- ScriptCode scriptTag);
- /* Differences from FSpCreate:
- FSpCreateCompat correctly sets the fdScript in the file's FXInfo record
- to scriptTag.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpDirCreateCompat(const FSSpec *spec,
- ScriptCode scriptTag,
- long *createdDirID);
- /* No known differences from FSpDirCreate.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpDeleteCompat(const FSSpec *spec);
- /* No known differences from FSpDelete.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpGetFInfoCompat(const FSSpec *spec,
- FInfo *fndrInfo);
- /* No known differences from FSpGetFInfo.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpSetFInfoCompat(const FSSpec *spec,
- const FInfo *fndrInfo);
- /* No known differences from FSpSetFInfo.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpSetFLockCompat(const FSSpec *spec);
- /* No known differences from FSpSetFLock.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpRstFLockCompat(const FSSpec *spec);
- /* No known differences from FSpRstFLock.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpRenameCompat(const FSSpec *spec,
- ConstStr255Param newName);
- /* No known differences from FSpRename.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpCatMoveCompat(const FSSpec *source,
- const FSSpec *dest);
- /* No known differences from FSpCatMove.
- */
-
- /*****************************************************************************/
-
- pascal OSErr FSpExchangeFilesCompat(const FSSpec *source,
- const FSSpec *dest);
- /* Differences from FSpExchangeFiles:
- Correctly exchanges files on volumes that don't support PBExchangeFiles.
- FSpExchangeFiles attempts to support volumes that don't support
- PBExchangeFiles, but in System 7, 7.0.1, 7.1, and 7 Pro, the
- compatibility code just doesn't work on volumes that don't support
- PBExchangeFiles (even though you may get a noErr result).
- Future versions of system softare will have the problems in
- FSpExchangeFiles corrected.
- */
-
- /*****************************************************************************/
-
- pascal short FSpOpenResFileCompat(const FSSpec *spec,
- SignedByte permission);
- /* No known differences from FSpOpenResFile.
- */
-
- /*****************************************************************************/
-
- pascal void FSpCreateResFileCompat(const FSSpec *spec,
- OSType creator,
- OSType fileType,
- ScriptCode scriptTag);
- /* Differences from FSpCreateResFile:
- FSpCreateResFileCompat correctly sets the fdScript in the file's
- FXInfo record to scriptTag.
- */
-
- /*****************************************************************************/
-
- #endif
-
-